from glob import glob
from commands import getoutput as gop

for i in range(10):
	images = glob('%d/*.bmp' % i)
	#gop('mkdir %d%s' % (i,'tiff'))
	for img in images:
		gop('convert %s %d%s/%s.tiff' % (img, i, 'tiff', img[2:-4]))
		print 'convert %s %d%s/%s.tiff' % (img, i, 'tiff', img[:-4])
